<template>
  <view></view>
</template>

<script>
export default {
  data() {
    return {
      group_id: '',
      name: '',
      xq: {},
      is_join: '',
      is_mobile: '',
      type_status: 'center',
      is_mobile: '',
      is_edit: ''
    }
  },
  onLoad(option) {
    if (option.group_id) {
      this.group_id = option.group_id
      this.name = option.name
    } else {
      let sceneStr = decodeURIComponent(option.scene);//这里的值就是二维码里带的参数值
      console.log("sceneStr", sceneStr)
      this.group_id = sceneStr
      this.name = ''
    }

    this.shou()
  },
  methods: {
    shou: function () {
      let that = this
      this.post('api/im/im/invite_wechat_group', { group_id: this.group_id }, true).then(res => {
        console.log(res)
        if (res.code == 1) {
          this.xq = res.data.group
          this.is_join = res.data.is_join
          this.is_mobile = res.data.is_mobile
          this.is_edit = res.data.is_edit
          if (res.data.is_join == 1) {
            uni.switchTab({
              url: '/pages/index/xiaoxi'
            })
            return
          } else {
            uni.reLaunch({
              url: '/subpages/pages/ql_yq?group_id=' + that.group_id + '&name=' + that.name
            })
            return
          }
        }
      })
    },
    quxiao1: function () {
      this.$refs.popup1.close()
    },
    login1: function (e) {
      console.log(e)
      let that = this
      this.$refs.popup1.close()
      uni.login({
        provider: 'weixin',
        success: (code) => {
          console.log(code)
          this.post1('api/wechat/phone', {
            code: code.code,
            iv: e.detail.iv,
            encryptedData: e.detail.encryptedData
          }, false).then(res => {
            console.log(res, '123455')
            if (res.code == 1) {
              uni.setStorageSync('mobile', res.data.phoneNumber)
              uni.setStorageSync('mobile2', res.data.mobile2)
              that.shou()
            } else {
              uni.showToast({
                title: res.msg,
                icon: "none",
                duration: 1000
              })
            }

          })

        }
      })
    },
  },
  mounted() {
    const that = this
    // this.getSysHeightInfo()
    //#ifdef H5
    window.onscroll = function () {
      var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
      if (scrollTop > 30) {
        that.isScroll = true
      } else {
        that.isScroll = false
      }
    }
    //#endif

  },
  onPageScroll(t) {

    t.scrollTop > 20 ? this.xiao = false : this.xiao = true;
    // t.scrollTop > 80 ? this.da = true : this.da = false;

  },
  watch: {
    scrollTop(newValue, oldValue) {
      //#ifdef MP-WEIXIN
      const that = this
      if (newValue > 1) {
        that.isScroll = true
      } else {
        that.isScroll = false
      }
      //#endif
    }
  },
}
</script>

<style lang="scss">
.footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #f4f4f4;
  margin-top: 30rpx;
  padding-bottom: 20rpx;

  button {
    margin: 0 auto;
    width: 100%;
    background-color: #19be6b;
    // width: 200upx;
    border-radius: 10upx;
    font-size: $uni-font-size-sm;
    // padding: 22upx 34upx;
    height: 80upx;
    font-size: 30rpx;
    line-height: 80upx !important;
    // line-height: 1;
    color: #ffffff;
  }

  button:after {
    border: 0;
  }
}
page {
  font-family: Demibold;
  height: 100vh;
}
.shang_city {
  width: 92%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  padding-bottom: 40rpx;
}
.hai {
  text-align: center;
  font-size: 30rpx;
  color: #000;
}
// 头部
.navbar {
  width: 100%;
  overflow: hidden;
  top: 0;
  left: 0;
  z-index: 999;
  flex-shrink: 0;
  color: #fff;
  font-size: 16px;
}

.nav-normal {
  position: relative;
}

.nav-fixed {
  position: fixed;
}

.header {
  position: fixed;
  width: 100%;
}

.logo-centent {
  display: flex;
  align-items: center;
}

.logo-centent image {
  width: 260rpx;
  height: 68rpx;
  margin-left: 20rpx;
}

.hearder-status {
  display: flex;
  align-items: center;
  position: absolute;
  padding-left: 30rpx;
  height: 100%;
  z-index: 99999;
}

.header-title {
  height: 100%;
  left: 0;
  right: 0;
  position: absolute;
  margin: auto;
  text-align: center;
}

.header-title image {
  position: absolute;
  width: 270rpx;
  height: 35rpx;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.header-title-left {
  height: 100%;
  left: 0;
  right: 0;
  position: absolute;
  margin: auto;
  text-align: left;
}

.back-text {
  margin-left: 7px;
  width: 100upx;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.hearder-status .nav-title-left {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(0, 0, 0, 0.8);
  width: 100%;
  font-weight: bold;
}

.hearder-status .nav-btn {
  /* background-color: rgba(255, 255, 255, .5);
		border-radius: 15px; */
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(0, 0, 0, 0.8);
  width: 50%;
  font-weight: bold;
}

.hearder-status .nav-btn .gotback,
.hearder-status .nav-btn .gothome {
  flex: 1;
  text-align: center;
  font-size: 18px;
}

.Addslot {
  position: absolute;
  width: 100%;
}
</style>